package self.hoy.demo.grainmall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import self.hoy.demo.common.to.auth.WeiboUser;
import self.hoy.demo.common.utils.PageUtils;
import self.hoy.demo.grainmall.member.entity.Member;
import self.hoy.demo.grainmall.member.vo.MemberLoginVo;
import self.hoy.demo.grainmall.member.vo.MemberRegisterVo;

import java.util.Map;

/**
 * 会员
 *
 * @author Hoy
 * @email xxx@gmail.com
 * @date 2020-07-04 22:40:35
 */
public interface MemberService extends IService<Member> {

    PageUtils queryPage(Map<String, Object> params);

    boolean isEmailUnique(String email);

    boolean isPhoneNumberUnique(String phoneNumber);

    boolean isUserNameUnique(String userName);

    /**
     * 账号注册
     * @param vo
     */
    void register(MemberRegisterVo vo);

    /**
     * 账号登录
     * @param vo
     * @return
     */
    Member login(MemberLoginVo vo);

    /**
     * 社交账号注册、登录
     * @param vo
     * @return
     */
    Member login(WeiboUser vo);
}

